<?php
/**
 * Created by PhpStorm.
 * User: 技术员专用
 * Date: 2019/3/15
 * Time: 11:32
 */

$http=new swoole_http_server('0.0.0.0',8811);
$http->on('request',function ($request,$response){
    $redis = new Swoole\Coroutine\Redis();
    $redis->connect('127.0.0.1', 6379);
    $redis->set('key1', $request->get['a']);
    $value = $redis->get('key1');
    var_dump($value);
    $response->header("Content-Type", "text/plain");
    $response->end($value);
});
$http->start();

